package com.fengzuxiao.weatherdemo.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class DBHelper extends SQLiteOpenHelper {

    public DBHelper(Context context) {
        super(context, "forecast.db",null,1);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {

        //创建表的操作
        String sql = "create table info(id integer primary key autoincrement,city varchar(20) unique not null,content text not null)";
        db.execSQL(sql);
        db.execSQL("create table user(id integer primary key autoincrement,username varchar(20) ,password varchar(20) )");

    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
